package com.sogoodsoft.util;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class InfoSpringUtil {
	public static Object getBean(HttpServletRequest request, String beanName) {
		Object obj = null;
		WebApplicationContext context = WebApplicationContextUtils
				.getWebApplicationContext(request.getSession()
						.getServletContext());
		obj = context.getBean(beanName);
		return obj;
	}
}
